import { createRouter, createWebHistory,createWebHashHistory } from "vue-router";

//路由数组
const routes = [
    {
        //基本格式
        path: "/",
        name: "setp",
        component: () => import("../view/setp/setp.vue"),
    },
    {
        //基本格式
        path: "/painter",
        name: "painter",
        component: () => import("../view/painter/painter.vue"),
    },
     {
        //基本格式
        path: "/router",
        name: "router",
        component: () => import("../view/router/router.vue"),
    },
    {
        //基本格式
        path: "/login",
        name: "login",
        component: () => import("../view/login/login.vue"),
    },
    {
        //基本格式
        path: "/helloworld",
        name: "helloworld",
        component: () => import("../view/HelloWorld/HelloWorld.vue"),
    },
    {
        //基本格式
        path: "/cj",
        name: "cj",
        component: () => import("../view/cj/cj.vue"),
    },
    {
        //基本格式
        path: "/edit",
        name: "edit",
        component: () => import("../view/edit/edit.vue"),
    },
    {
        //基本格式
        path: "/diary-list",
        name: "diary-list",
        component: () => import("../view/diary-list/diary-list.vue"),
        meta:{
            title:'日寄'
        }
    },
    {
        //基本格式
        path: "/fireworks",
        name: "fireworks",
        component: () => import("../view/fireworks/fireworks.vue"),
        meta:{
            title:'烟花'
        }
    },
    {
        //基本格式
        path: "/qing",
        name: "qing",
        component: () => import("../view/qing/qing.vue"),
        meta:{
            title:'love青'
        }
    },
];



//路由对象
const router = createRouter({
    history: createWebHashHistory(),
    routes, //上面的路由数组
});

router.beforeEach((to,from,next)=>{
   console.log()
    next()
})

//导出路由对象，在main.js中引用
export default router;
